import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/dist/index.css'

const app = createApp(App);
// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}

// 在应用挂载前分发 loadUserInfo action
store.dispatch('user/loadUserInfo');

app.use(store)
    .use(router)
    .use(ElementPlus)
    .mount('#app');